/*
 * FileWritable.cpp
 *
 *  Created on: 12/10/2011
 *      Author: gisedaye
 */

#include "FileWritable.h"


void FileWritable::writeToFile(string filename, string data){
	ofstream fileWrite(filename.c_str(),ios::out|ios::binary);
	fileWrite.write(data.c_str(),data.length());
	fileWrite.close();
}
void FileWritable::writeToFileEnd(string filename, string data){
	ofstream fileWrite(filename.c_str(),ios::out|ios::binary|ios::app);
	fileWrite.write(data.c_str(),data.length());
}
void FileWritable::writeToFilePosition(string filename,int start, string data){
	ofstream fileWrite(filename.c_str(),ios::out|ios::binary);
	fileWrite.seekp(start);
	fileWrite.write(data.c_str(),data.length());
}
